﻿@using Abp.Application.Services.Dto
@using Akso.Entities
@using Akso.Web.Areas.Mpa.Models.Common.Modals
@model Akso.Web.Areas.EduAdminModule.Models.Courses.CreateOrEditCourseModalViewModel
@Html.Partial("~/Areas/Mpa/Views/Common/Modals/_ModalHeader.cshtml", new ModalHeaderViewModel(Model.IsEditMode ? (L("Pages_EduAdminModule_Courses_Edit") + ": " + Model.Course.CourseName) : L("Pages_EduAdminModule_Courses_Create")))
<div class="modal-body">
    <div class="tabbable-line">
        <ul class="nav nav-tabs ">
            <li class="active">
                <a href="#CourseInformationsTab" data-toggle="tab" aria-expanded="true">
                    @L("Pages_EduAdminModule_Tab_Courses")
                </a>
            </li>
            <li class="">
                <a href="#CourseSchedulesTab" data-toggle="tab" aria-expanded="false">
                    @L("Pages_EduAdminModule_Tab_CourseSchedules")
                </a>
            </li>
        </ul>
        <div class="tab-content">
            <div class="tab-pane active" id="CourseInformationsTab">
                <form name="ObjectForm" role="form" novalidate class="form-validation">

                    @if (Model.IsEditMode)
                    {
                        <input type="hidden" name="Id" value="@Model.Course.Id" />
                    }

                    <div class="row">
                        <div class="col-sm-7">
                            <div class="form-group form-md-line-input no-hint">
                                <input type="text" name="CourseName" id="CourseName" value="@Model.Course.CourseName" class="form-control edited" required maxlength="@CourseEntity.MaxNameLength" />
                                <label>@L("Page_EduAdminModule_Courses_GridColumn_CourseName")</label>
                            </div>
                        </div>
                        <div class="col-sm-3">
                            <div class="form-group form-md-line-input form-md-floating-label no-hint">

                                <div class="md-checkbox">
                                    <input id="IsAutoCreateName" class="md-check" type="checkbox" name="IsAutoCreateName" value="true" @Html.Raw(Model.Course.IsAutoCreateName ? "checked=\"checked\"" : "") />


                                    @*<input id="IsAutoCreateName" class="md-check" type="checkbox" name="IsAutoCreateName" value="@Model.Course.IsAutoCreateName" />*@
                                    <label for="IsAutoCreateName">
                                        <span class="inc"></span>
                                        <span class="check"></span>
                                        <span class="box"></span>
                                        @L("Page_EduAdminModule_Courses_GridColumn_AutoCreateName")
                                    </label>
                                </div>

                            </div>
                        </div>

                        <div class="col-sm-6">
                            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                                @Html.DropDownList("Years", Model.GetYearList, new { @class = "form-control edited" })
                                <label>@L("Page_EduAdminModule_Courses_GridColumn_Year")</label>
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <div class="form-group form-md-line-input form-md-floating-label no-hint">

                                @Html.DropDownList("PeriodGUID", Model.GetCourseTermList.Select(a => a.ToSelectListItem()), new { @class = "form-control edited" })
                                <label>@L("Page_EduAdminModule_Courses_GridColumn_Period")</label>
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                                @Html.DropDownList("GradeGUID", Model.GetCourseGradeList.Select(a => a.ToSelectListItem()), new { @class = "form-control edited" })
                                <label>@L("Page_EduAdminModule_Courses_GridColumn_Grade")</label>
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                                @Html.DropDownList("SubjectGUID", Model.GetCourseSubjectList.Select(a => a.ToSelectListItem()), new { @class = "form-control edited" })
                                <label>@L("Page_EduAdminModule_Courses_GridColumn_Subject")</label>
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                                @Html.DropDownList("SubjectTypeGUID", Model.GetCourseSubjectTypeList.Select(a => a.ToSelectListItem()), new { @class = "form-control edited" })
                                <label>@L("Page_EduAdminModule_Courses_GridColumn_SubjectType")</label>


                            </div>
                        </div>
                        <div class="col-sm-6">
                            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                                @Html.EnumDropDownListFor(x => x.ChargeTypeList, new { @class = "form-control" })
                                <label>@L("Page_EduAdminModule_Courses_GridColumn_ChargeType")</label>
                            </div>
                        </div>

                    </div>
                    <div class="row">


                        <div class="col-sm-6">
                            <div class="form-group form-md-line-input form-md-floating-label no-hint">

                                <div class="md-checkbox">
                                    <input id="IsAnQi" class="md-check" type="checkbox" name="IsAnQi" value="@Model.Course.IsAnQi" />
                                    <label for="IsAnQi">
                                        <span class="inc"></span>
                                        <span class="check"></span>
                                        <span class="box"></span>
                                        @L("Page_EduAdminModule_Courses_GridColumn_IsAnQi")
                                    </label>

                                </div>
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                                <div id="Times">期</div>
                                <input type="text" name="ChargeTime" id="ChargeTime" value="@Model.Course.ChargeTime" class="form-control edited" />
                                <label id="lblText"></label>
                            </div>
                        </div>

                    </div>

                    <div class="row">
                        <div class="col-sm-6">
                            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                                <input type="text" name="Price" value="@Model.Course.Price" class="form-control edited" required />
                                <label>@L("Page_EduAdminModule_Courses_GridColumn_Price")</label>

                            </div>
                        </div>
                        <div class="col-sm-5">
                            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                                <div id="PriceUnits">元</div>
                            </div>

                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-6">
                            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                                <label>@L("Page_EduAdminModule_Courses_GridColumn_CourseType")</label>
                                @foreach (var item in Model.GetCourseTypeList)
                                {
                                    string checkStr = Model.GetCourseTypeList != null ? (item.CodeKey == Model.Course.CourseType ? "checked=\"checked\"" : "") : "";

                                    @*@Html.RadioButtonFor(model => model.GetCourseTypeList,item.CodeKey,  new { @id = item.CodeKey, @checked= checkStr })@item.CodeName*@
                                    <input id="CourseType_@(item.CodeKey)" type="radio" name="CourseType" value="@item.CodeKey" @checkStr />@item.CodeName
                                }



                            </div>
                        </div>
                        <div class="col-sm-6">
                            <div class="form-group form-md-line-input form-md-floating-label no-hint">

                                <div class="md-checkbox">
                                    <input id="IsDisable" class="md-check" type="checkbox" name="IsDisable" value="true" @Html.Raw(Model.Course.IsDisable ? "checked=\"checked\"" : "") />
                                    <label for="IsDisable">
                                        <span class="inc"></span>
                                        <span class="check"></span>
                                        <span class="box"></span>
                                        @L("Page_EduAdminModule_Courses_GridColumn_IsDisable")
                                    </label>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-12">
                            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                                <input type="text" name="Remark" value="@Model.Course.Remark" class="form-control edited" maxlength="@CourseEntity.MaxRemarkLength" />
                                <label>@L("Page_EduAdminModule_Courses_GridColumn_Remark")</label>
                            </div>
                        </div>
                    </div>

                </form>
            </div>
            <div class="tab-pane" id="CourseSchedulesTab">
                <!--显示数据的网格区域-->
                <div id="DataTableSchedule"></div>
                <button style="width:100px" id="btnAddRow">新增</button>
                
            </div>
        </div>
    </div>
    

</div>

@Html.Partial("~/Areas/Mpa/Views/Common/Modals/_ModalFooterWithSaveAndCancel.cshtml")
